// 该文件用于创建整个应用的路由器
import VueRouter from 'vue-router'

import About from '@/pages/About'
import Home from '@/pages/Home'
import Message from '@/pages/Message'
import News from '@/pages/News'
import Deatil from '@/pages/Detail'


// 创建并暴露一个路由器
export default new VueRouter({
    routes:[
        {
            path:"/about",
            component:About
        },
        {
            path:'/home',
            component:Home,
            // 子级目录
            children:[
                {
                    path:'news',
                    component:News
                },
                {
                    // 注意子级目录不需要加 / !!!!!
                    path:'message',
                    component:Message,
                    children:[
                        {
                            path:'detail',
                            component:Deatil
                        }
                    ]
                },
            ]
        },
    ]
})
